<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta name="renderer" content="webkit">
<title></title>
<link rel="stylesheet" href="{:C('ADMIN_CSS_URL')}pintuer.css">
<link rel="stylesheet" href="{:C('ADMIN_CSS_URL')}admin.css">
<script src="{:C('ADMIN_JS_URL')}jquery.js"></script>
<script src="{:C('ADMIN_JS_URL')}pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
  <div class="padding border-bottom">
    <button type="button" class="button border-yellow" onclick="window.location.href='{:U('Cate/add')}'"><span class="icon-plus-square-o"></span> 添加分类</button>
  </div>
  <table class="table table-hover text-center">
    <tr>
      <th width="5%">ID</th>
      <th width="15%">分类名称</th>
      <th width="10%">分类描述</th>
      <th width="10%">操作</th>
    </tr>
    <foreach name="cate_info" item="v">
        <tr>
            <td>{$v.cate_id}</td>
            <td>{$v.cate_name}</td>
            <td>{$v.cate_description}</td>
            <td><div class="button-group"> <a class="button border-main" href="{:U('Cate/upd',array('cate_id'=>$v['cate_id']))}"><span class="icon-edit"></span> 修改</a> <a class="button border-red" href="javascript:void(0)" onclick="if(confirm('你确定删除吗？')){del({$v.cate_id})}"><span class="icon-trash-o"></span> 删除</a> </div></td>
        </tr>
    </foreach>
  </table>
</div>
<script type="text/javascript">
function del(cate_id){
    $.ajax({
        url:"{:U('Cate/delete')}",
        data:{'cate_id':cate_id},
        dataType:'json',
        type:'post',
        success:function(msg){
            if(msg.status==1){
                window.location.href="{:U('Cate/showlist')}";
            }
        }
    });
}
</script>
</body>
</html>